package com.spi.soconversion.base.definition;

import com.spi.soconversion.util.SOCConstants;
import com.spi.soconversion.util.SOCUtility;
import com.spi.soconversion.util.XMLAttributeConstants;
import com.spi.soconversion.util.XMLTagConstants;

public class SOCOrderLineStatus {

	private String releaseNo;
	private String status;
	private String statusDate = SOCConstants.EMPTY_STRING;
	private String statusQty;
	private SOCOrderLineSchedule lineschedule = new SOCOrderLineSchedule();
	
	public SOCOrderLineSchedule getLineschedule() {
		return lineschedule;
	}

	public void setLineschedule(SOCOrderLineSchedule lineschedule) {
		this.lineschedule = lineschedule;
	}
	
	@Override
	public String toString(){
		StringBuffer sb = new StringBuffer();
		
		sb.append(XMLTagConstants.START_TAG_ORDER_STATUSES);
		sb.append(SOCConstants.NEW_LINE);
		
		sb.append(XMLTagConstants.START_TAG_ORDER_STATUS);
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.RELEASE_NUM, getReleaseNo()));		
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.STATUS, getStatus()));		
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.STATUS_DATE, getStatusDate()));		
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.STATUS_QTY, getStatusQty()));
		sb.append(SOCConstants.BLANK_STRING);		
		
		sb.append(SOCConstants.CLOSING_XML_TAG);
		
		String lineschedule=getLineschedule().toString();
		if(lineschedule.length()>0)
		{
			sb.append(SOCConstants.NEW_LINE);
			sb.append(lineschedule);
		}

//		sb.append(SOCConstants.NEW_LINE);
//		sb.append(XMLTagConstants.END_TAG_ORDER_STATUS);
		
		
		return sb.toString();
	}
	
	public String getReleaseNo() {
		return SOCUtility.checkNull(releaseNo);
	}

	public void setReleaseNo(String releaseNo) {
		this.releaseNo = releaseNo;
	}
	
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public String getStatusDate() {
		return statusDate;
	}

	public String getStatusQty() {
		return statusQty;
	}

	public void setStatusQty(String statusQty) {
		this.statusQty = statusQty;
	}
}
